<?php

namespace app\common\service;

use think\Db;

class SystemService{

	/*
	清除日志
	 */
	public static function clearIpsLog(){
		$res = Db::table('tp_ips')->whereTime('date','<',date('Y-m-d H:i:s', strtotime('-14 days')))->delete();
		return $res;
	}

	

	/*
    获取邀请码
     */
    public static function getEosAddress($uid){
        $str = md5($uid.uniqid().microtime().rand(1,9));
        $invite_code = substr($str, 0,10);
        $res = Db::table('tp_user_wallet_address')->where('cid',5)->where('address',$invite_code)->find();
        if($res){
            self::getEosAddress($uid);
        } else {
            return $invite_code;
        }
    }
}